from artifacts.base.base_artifacts import Artifacts
from artifacts.base.sr.relics_impl import *
from common.random_util import select_one_from_weight_map


class RelicsFactory:
    suit_weight_map = {
        Artifacts.SUIT_A: 50,
        Artifacts.SUIT_B: 50,
    }

    count_weight_map = {
        2: 90,
        3: 10,
    }

    out_weight_map = {
        Head: 25,
        Hands: 25,
        Body: 25,
        Feet: 25,
    }

    in_weight_map = {
        Link: 50,
        Sphere: 50,
    }

    @staticmethod
    def create_out_relics_list():
        return [select_one_from_weight_map(RelicsFactory.out_weight_map)(
            select_one_from_weight_map(RelicsFactory.suit_weight_map)) for _ in
                range(select_one_from_weight_map(RelicsFactory.count_weight_map))]

    @staticmethod
    def create_in_relics_list():
        return [select_one_from_weight_map(RelicsFactory.in_weight_map)(
            select_one_from_weight_map(RelicsFactory.suit_weight_map)) for _ in
            range(select_one_from_weight_map(RelicsFactory.count_weight_map))]


if __name__ == '__main__':
    for i in range(20):
        artifacts_list = RelicsFactory.create_out_relics_list()
        for artifacts in artifacts_list:
            artifacts.upgrade_max()
            print(artifacts)
        print('----------------------------------------------')
        print()
